import React, { useState } from 'react'
import useData from "./utils/Use_Data"
type Props = {}

const My_feach = (props: Props) => {
    const [url,setUrl] = useState("http://localhost:3000/api/login")
    const result = useData(url)
    console.log(result);
    
  return (
    <div>My_feach
        <input style={{width:"400px"}} type="text" value={url} onChange={(e)=>setUrl(e.target.value)}/>
        {
          result.isLoading && <h1>loading....</h1>
        }
        {
          result.isErroy && <h1>error</h1>
        }
        {
          result.data?.map((item:any)=>{
            <h1>{item.menuName}</h1>
          })
        }
    </div>
  )
}

export default My_feach